﻿//===============================================================================
// Microsoft Innovation Centre - Western Europe
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System;
using System.Runtime.Serialization;

namespace Microsoft.WVB.Server
{
    [DataContract]
    public class ValidateMembershipUserRequest
    {
        [DataMember]
        public String Username { get; set; }
        [DataMember]
        public String Password { get; set; }
    }

    [DataContract]
    public class UpdateMembershipUserRequest
    {
        [DataMember]
        public WVBUser User { get; set; }
    }

    [DataContract]
    public class GetMembershipUserResponse
    {
        [DataMember]
        public WVBUser User { get; private set; }

        public GetMembershipUserResponse(WVBUser user)
        {
            this.User = user;
        }
    }

    [DataContract]
    public class GetMembershipUserRequest
    {
        [DataMember]
        public String Username { get; set; }
    }

    [DataContract]
    public class DeleteMembershipUserRequest
    {
        [DataMember]
        public bool DeleteAllRelatedData { get; set; }
        [DataMember]
        public String Username { get; set; }
    }

    [DataContract]
    public class CreateMembershipUserResponse
    {
        [DataMember]
        public WVBUser User { get; private set; }
        [DataMember]
        public MembershipCreateStatus Status { get; private set; }

        public CreateMembershipUserResponse(WVBUser user, MembershipCreateStatus status)
        {
            this.User = user;
            this.Status = status;
        }
    }

    [DataContract]
    public class CreateMembershipUserRequest
    {
        [DataMember]
        public String Username { get; set; }
        [DataMember]
        public String Password { get; set; }
        [DataMember]
        public String Email { get; set; }
    }

    [DataContract]
    public enum MembershipCreateStatus
    {
        [EnumMember(Value = "Failure")]
        Failure,
        [EnumMember(Value = "Success")]
        Sucess,
        [EnumMember(Value = "InvalidUserName")]
        InvalidUserName,
        [EnumMember(Value = "InvalidPassword")]
        InvalidPassword,
        [EnumMember(Value = "InvalidEmail")]
        InvalidEmail,
        [EnumMember(Value = "DuplicateUserName")]
        DuplicateUserName,
        [EnumMember(Value = "DuplicateEmail")]
        DuplicateEmail,
        [EnumMember(Value = "UserRejected")]
        UserRejected,
        [EnumMember(Value = "ProviderError")]
        ProviderError,
        [EnumMember(Value = "NotApplicable")]
        NotApplicable
    }
}
